import QtQuick 2.4
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Qt.labs.controls 1.0
import QtQuick.Layouts 1.1

PopupFrame{
    id: pop
    title: "选择日期"
    property alias selectedDate:calendar.selectedDate

    contentHeight:370

    Pane {
        anchors.centerIn: parent
        Calendar {
            id: calendar
            anchors.fill: parent
            onClicked: {pop.close();  pop.clicked()}
            style: CalendarStyle {
                gridVisible: false

                dayDelegate: Rectangle {
                    Label {
                        text: styleData.date.getDate()
                        anchors.centerIn: parent
                        color: styleData.valid ? "deepskyblue" : "dimgray"
                    }

                    Rectangle {
                        width: parent.width
                        height: 1
                        color: "whitesmoke"
                        anchors.bottom: parent.bottom
                    }

                    Rectangle {
                        width: 1
                        height: parent.height
                        color: "whitesmoke"
                        anchors.right: parent.right
                    }
                }
            }
        }
    }
}

